package npr.gui;

import processing.core.*;

public class IntField extends FloatField{


    public IntField(int xpos, int ypos, int width, int minValue, int maxValue, int initValue, String label){
	this(xpos, ypos, width, 22, null, defaultFontSize, minValue, maxValue, initValue, label);
    }


    public IntField(int xpos, int ypos, int width, int height, PFont font, int fontSize, int minValue, int maxValue, int initValue, String label){

	super(xpos, ypos, width, height, font, fontSize, minValue, maxValue, initValue, 1, 0, label);
    }


     protected void keyPressed(char keyChar, int keyCode){

	 super.keyPressed(keyChar, keyCode);
	 if(hasInput){
	     int newValue= (int)getValue();
	     setValue((float)newValue);
	 }
    }
}
